package section002.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Controller extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public Controller() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String action = request.getParameter("action");
		
		String page = null;
		
		
		if(action == null)
		{
			page = "/Sections/section002/ModelVsModel2Architecture/error.jsp";
		}
		
		
		else if(action.equals("about"))
		{
			page = "/Sections/section002/ModelVsModel2Architecture/about.jsp";
		}
		
		
		else if(action.equals("login"))
		{
			page = "/Sections/section002/ModelVsModel2Architecture/login.jsp";
		}
		getServletContext().getRequestDispatcher(page).forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

}
